from selenium import webdriver

url = 'https://www.baidu.com'

driver = webdriver.Chrome()

driver.get(url)

driver.find_element_by_id('kw').send_keys('python')

print(driver.current_url)
print(driver.window_handles)

# driver.find_element_by_id('su').click()
el = driver.find_element_by_xpath('/html/body/div[1]/div[1]/div[5]/div/div/form/span[2]/input')
el.click()

print(driver.current_url)
print(driver.window_handles)

